import java.util.*;

public class SortTest {
	public static void main(String[] args)
	{
		Em[] staff = new Em[3];
		
		staff[0] = new Em("guadf",12334);
		staff[1] = new Em("fadfii",3442);
		staff[2] = new Em("fdfaf",33);
		
		Arrays.sort(staff);
		
		for(Em e:staff)
			System.out.println("name " + e.getName() + ",salary " + e.getSalary());
	}

}


class Em implements Comparable<Em>
{
	public Em(String n, double s)
	{
		name = n;
		salary = s;
	}
	
	public String getName()
	{
		return name;
	}
	
	public double getSalary()
	{
		return salary;
	}
	
	public int compareTo(Em other)
	{
		if(name.hashCode() < other.name.hashCode()) return -1;
		if(name.hashCode() > other.name.hashCode()) return 1;
		return 0;
	}
	
	private String name;
	private double salary;

}